package com.zhanglingfei.yuekaoclient.config;

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RoundRobinRule;
import feign.Retryer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


/**
 * Feign配置
 * https://www.liujiajia.me/2019/01/22/feign-retry/
 * https://www.cnblogs.com/moonandstar08/p/7565442.html
 * https://www.jianshu.com/p/06d63344536b
 */
@Configuration
public class FeignConfig {


    @Bean
    public IRule iRule() {
//        return new RandomRule();
        return new RoundRobinRule();
    }

    @Bean
    public Retryer retryer() {
//        return new Retryer.Default(100, 1000, 5);
        return new Retryer.Default();
    }
}
